package structuralModel.agentModel.staticProxy;

/**
 * @author Administrator
 * @date 2023/12/29
 */
public class StaticProxy implements Rent{

    // 被代理对象
    private Rent rent;

    public void setRent(Rent rent) {
        this.rent = rent;
    }

    @Override
    public void rent() {
        beforeRent();
        rent.rent();
        afterRent();

    }

    private void beforeRent() {
        System.out.println("我是中介,我带你去看房子");
    }

    private void afterRent() {
        System.out.println("我是中介,租完房子之后我要收取佣金了");
    }
}
